# -*- coding: utf-8 -*-
# @Author: home-holy
# @Date:   2020-04-10 22:23:02
# @Last Modified by: CPS
# @Last Modified time: 2020-08-19 15:51:35
from subprocess import Popen, PIPE
import os
import sys


HAS_NODE = False

try:
    p = Popen(
        ['node', '-v'],
        stdout=PIPE,
        stdin=PIPE,
        stderr=PIPE
    )
except Exception:
    HAS_NODE = False
else:
    res, err = p.communicate()
    if res:
        HAS_NODE = True
    else:
        HAS_NODE = False

print(HAS_NODE)
